﻿using System;
using System.Linq;
using System.Text;
using NUnit;
using NUnit.Framework;
using EventbriteService;
using EventbriteService.Adapter;
using EventbriteService.Model;
using EventbriteService.Factory;

namespace ClientTests
{

    //  https://www.eventbriteapi.com/v3/events/search/?venue.city=Salt+Lake+City&venue.region=UT&venue.country=US&categories=101&token=IPABMHOL4CSQ5DGJ36SQ
    [TestFixture]
    public class MapperTest
    {
        [Test]
        public void TestOrganizerMappingJsonArray()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.OrganizerJsonArray);
            Mapper<Organizer> mapper = new Mapper<Organizer>(jsonAdapter);
            AssertOrganizer(mapper.BuildInstance());

        }

        [Test]
        public void TestOrganizerMappingJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.OrganizerJson);
            Mapper<Organizer> mapper = new Mapper<Organizer>(jsonAdapter);
            AssertOrganizer(mapper.BuildInstance());
        }

        [Test]
        public void TestUserMappingJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.UserJson);
            Mapper<User> mapper = new Mapper<User>(jsonAdapter);
            AssertUser(mapper.BuildInstance());
        }

        [Test]
        public void TestUserMappingJsonArray()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.UserJsonArray);
            Mapper<User> mapper = new Mapper<User>(jsonAdapter);
            AssertUser(mapper.BuildInstance());
        }

        [Test]
        public void TestVenueMappingJsonArray()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.VenueJsonArray);
            Mapper<Venue> mapper = new Mapper<Venue>(jsonAdapter);
            AssertVenue(mapper.BuildInstance());
        }

        [Test]
        public void TestVenueMappingJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.VenueJson);
            Mapper<Venue> mapper = new Mapper<Venue>(jsonAdapter);
            AssertVenue(mapper.BuildInstance());
        }

        [Test]
        public void TestAttendeeMappingJsonArray()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.AttendeeJsonArray);
            Mapper<Attendee> mapper = new Mapper<Attendee>(jsonAdapter);
            AssertAttendee(mapper.BuildInstance());
        }

        [Test]
        public void TestAttendeeMappingJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.AttendeeJson);
            Mapper<Attendee> mapper = new Mapper<Attendee>(jsonAdapter);
            AssertAttendee(mapper.BuildInstance());
        }

      
        [Test]
        public void TestEventMappingJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.Event);
            Mapper<Event> mapper = new Mapper<Event>(jsonAdapter);
            AssertEvent(mapper.BuildInstance());
        }

        [Test]
        public void TestEventWithExpensionsJson()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(JsonData.EventWithExpensions);
            Mapper<Event> mapper = new Mapper<Event>(jsonAdapter);
            AssertEventWithExpensions(mapper.BuildInstance());
        }

        [Test]
        public void CanParseCategories()
        {
            IDataAdapter jsonAdapter = new JsonAdapter(Categories);
            Mapper<Category> mapper = new Mapper<Category>(jsonAdapter);
            var categories = mapper.Build().ToArray();
            Assert.IsTrue(categories.Length == 20);


        }
        private void AssertOrganizer(Organizer organizer)
        {
            Assert.IsTrue(organizer.Description.Html == "<p>bla</p>");
            Assert.IsTrue(organizer.Description.Text == "test-organization");
            Assert.IsTrue(organizer.Id == 1111);
            Assert.IsTrue(organizer.Name == "test-organization");
            Assert.IsTrue(organizer.NumFutureEvents == null);
            Assert.IsTrue(organizer.NumPastEvents == 10);
            Assert.IsTrue(organizer.Url == "http://www.eventbrite.com/o/test-organization-1111");
        }


        private void AssertUser(User user)
        {
            Assert.IsTrue(user.Email == "test@test.com");
            Assert.IsTrue(user.Emails[0].Email == "test@test.com");
            Assert.IsTrue(user.Emails[0].Verified);
            Assert.IsTrue(user.FirstName == "test");
            Assert.IsTrue(user.Id == 4615917);
            Assert.IsTrue(user.LastName == "form");
            Assert.IsTrue(user.Name == "test");

        }

        private void AssertVenue(Venue venue)
        {
            Assert.IsTrue(venue.Id == 1524221);
            Assert.IsTrue(venue.Latitude == "37.77552");
            Assert.IsTrue(venue.Longitude == "-122.40007");
            Assert.IsTrue(venue.Name == "venue007");
            Assert.IsTrue(venue.Address.Address1 == "Apartment 106");
        }

        private void AssertAttendee(Attendee attendee)
        {
            Assert.IsTrue(attendee.Id == 11111111111);
            Assert.IsTrue(attendee.TicketClassId == 222);
            Assert.IsTrue(attendee.Created == DateTime.Parse("2013-06-17 09:54:45"));
            Assert.IsTrue(attendee.Profile.Name == "dddd");
            Assert.IsTrue(attendee.Profile.Age == 45);
            Assert.IsTrue(attendee.Profile.BirthDate == DateTime.Parse("1957-04-17"));
            Assert.IsTrue(attendee.Profile.Blog == "dsdsfs");
            Assert.IsTrue(attendee.Profile.Company == "zzzzzzzz");
            Assert.IsTrue(attendee.Profile.Email == "ssss@ddd.com");
            Assert.IsTrue(attendee.Profile.FirstName == "aaaa");
            Assert.IsTrue(attendee.Profile.Gender == "m");
            Assert.IsTrue(attendee.Profile.JobTitle == "ddddd");
            Assert.IsTrue(attendee.Profile.LastName == "ssss");
            Assert.IsTrue(attendee.Profile.CellPhone == "345-234-1122");
            Assert.IsTrue(attendee.Profile.Prefix == "dr.");
            Assert.IsTrue(attendee.Profile.Suffix == "jr");
            Assert.IsTrue(attendee.Profile.Website == "wetwetrwe");
            Assert.IsTrue(attendee.Addresses.Home.Address1 == "Apartment 106");
            Assert.IsTrue(attendee.Addresses.Home.Address2 == "45 Royal Street");
            Assert.IsTrue(attendee.Addresses.Home.City == "London");
            Assert.IsTrue(attendee.Addresses.Home.Region == "London");
            Assert.IsTrue(attendee.Addresses.Home.PostalCode == "SW1A 1AA");
            Assert.IsTrue(attendee.Addresses.Home.Country == "GB");
            Assert.IsTrue(attendee.Addresses.Home.CountryName == "United Kingdom");
            Assert.IsTrue(attendee.Answers[0].QuestionId == 24);
            Assert.IsTrue(attendee.Answers[0].Question == "dddddd");
            Assert.IsTrue(attendee.Answers[0].Type == "mmmm");
            Assert.IsTrue(attendee.Answers[0].Answer == "ddgdfg");
            Assert.IsTrue(attendee.Barcodes[0].Barcode == "ddddd");
            Assert.IsTrue(attendee.Barcodes[0].Status == "dddd");
            Assert.IsTrue(attendee.Team.Id == "ddd");
            Assert.IsTrue(attendee.Team.Name == "dddd");
            Assert.IsTrue(attendee.Team.DateJoined == DateTime.Parse("2013-06-17 09:54:45"));
            Assert.IsTrue(attendee.Team.EventId == 179947891);
            Assert.IsTrue(attendee.EventId == 6330882841);
            Assert.IsTrue(attendee.OrderId == 179947891);

        }
       
        private void AssertEvent(Event @event)
        {
            Assert.IsTrue(@event.Name.Html == "Event with Custom Q");
            Assert.IsTrue(@event.Name.Text == "Event with Custom Q");
            Assert.IsTrue(@event.Description.Html == null);
            Assert.IsTrue(@event.Description.Text == null);
            Assert.IsTrue(@event.Id == 11109810743);
            Assert.IsTrue(@event.Url == "http://www.eventbrite.com/e/event-with-custom-q-tickets-11109810743");
            Assert.IsTrue(@event.Start.TimeZone == "America/Los_Angeles");
            Assert.IsTrue(@event.Start.Local == "2016-11-30T19:00:00");
            Assert.IsTrue(@event.Start.Utc == "2016-12-01T03:00:00Z");
            Assert.IsTrue(@event.Created == DateTime.Parse("2014-03-27T22:27:04Z"));
            Assert.IsTrue(@event.Changed == DateTime.Parse("2015-12-04T01:11:55Z"));
            Assert.IsTrue(@event.Capacity == 1201);
            Assert.IsTrue(@event.Status == "live");
            Assert.IsTrue(@event.Currency == "USD");
            Assert.IsTrue(@event.OnlineEvent == true);



        }
          private void AssertEventWithExpensions(Event @event)
        {
            Assert.IsTrue(@event.Name.Html == "Event with Custom Q");
            Assert.IsTrue(@event.Name.Text == "Event with Custom Q");
            Assert.IsTrue(@event.Description.Html == null);
            Assert.IsTrue(@event.Description.Text == null);
            Assert.IsTrue(@event.Id == 11109810743);
            Assert.IsTrue(@event.Url == "http://www.eventbrite.com/e/event-with-custom-q-tickets-11109810743");
            Assert.IsTrue(@event.Start.TimeZone == "America/Los_Angeles");
            Assert.IsTrue(@event.Start.Local == "2016-11-30T19:00:00");
            Assert.IsTrue(@event.Start.Utc == "2016-12-01T03:00:00Z");
            Assert.IsTrue(@event.Created == DateTime.Parse("2014-03-27T22:27:04Z"));
            Assert.IsTrue(@event.Changed == DateTime.Parse("2015-12-04T01:11:55Z"));
            Assert.IsTrue(@event.Capacity == 1201);
            Assert.IsTrue(@event.Status == "live");
            Assert.IsTrue(@event.Currency == "USD");
            Assert.IsTrue(@event.OnlineEvent == true);
            
              // Expensions
            
              // Organizer:
            Assert.IsTrue(@event.Organizer.Description.Text == "SendOutCards");
            Assert.IsTrue(@event.Organizer.Description.Html == @"<P>SendOutCards</P>");
            Assert.IsTrue(@event.Organizer.Id == 311);
            Assert.IsTrue(@event.Organizer.Name == "SendOutCards");
            Assert.IsTrue(@event.Organizer.NumFutureEvents == 4);
            Assert.IsTrue(@event.Organizer.NumPastEvents == 39);
            Assert.IsTrue(@event.Organizer.Url == "http://www.eventbrite.com/o/sendoutcards");
            
           // Venue
            Assert.IsTrue(@event.Venue.Address.Address1 == "100 West");
            Assert.IsTrue(@event.Venue.Address.Address2 == null);
            Assert.IsTrue(@event.Venue.Address.City == "City");
            Assert.IsTrue(@event.Venue.Address.Country == "US");
            Assert.IsTrue(@event.Venue.Address.Region == "UT");
            Assert.IsTrue(@event.Venue.Address.Latitude == "40.7669304");
            Assert.IsTrue(@event.Venue.Address.Longitude == "-111.89518520000001");
            Assert.IsTrue(@event.Venue.Address.PostalCode == "84101");
            Assert.IsTrue(@event.Venue.Id == 11454554);
            Assert.IsTrue(@event.Venue.Latitude == "40.7669304");
            Assert.IsTrue(@event.Venue.Longitude == "-111.89518520000001");
            Assert.IsTrue(@event.Venue.Name == "Convention Center");

            // Category
            Assert.IsTrue(@event.Category.Id == 101);
            Assert.IsTrue(@event.Category.Name == "Business & Professional");
            Assert.IsTrue(@event.Category.NameLocalized == "Business & Professional");
            Assert.IsTrue(@event.Category.ShortName == "Business");
            Assert.IsTrue(@event.SubCategory.Id == 1007);
            Assert.IsTrue(@event.SubCategory.Name == "Sales & Marketing");

              //  Format
            Assert.IsTrue(@event.Format.Id == 4);
            Assert.IsTrue(@event.Format.Name == "Convention");
            Assert.IsTrue(@event.Format.ShortName == "Convention");

              //  Logo
            Assert.IsTrue(@event.Logo.Id == 20016442);
            Assert.IsTrue(@event.Logo.Url == "https://img.evbuc.com/d310");
            Assert.IsTrue(@event.Logo.AspectRatio == "2");
            
              // Tickets
            Assert.IsTrue(@event.TicketClasses.Count == 2);
            Assert.IsTrue(@event.TicketClasses[0].Cost.Currency == "USD");
            Assert.IsTrue(@event.TicketClasses[0].Cost.Display == "$50.00");
            Assert.IsTrue(@event.TicketClasses[0].Cost.Value == 5000);
            Assert.IsTrue(@event.TicketClasses[0].Fee.Currency == "USD");
            Assert.IsTrue(@event.TicketClasses[0].Fee.Display == "$3.74");
            Assert.IsTrue(@event.TicketClasses[0].Fee.Value == 374);
            Assert.IsTrue(@event.TicketClasses[0].Tax.Currency == "USD");
            Assert.IsTrue(@event.TicketClasses[0].Tax.Display == "$0.00");
            Assert.IsTrue(@event.TicketClasses[0].Tax.Value == 0);
            Assert.IsTrue(@event.TicketClasses[0].Description == "Tickets are priced per person");
            Assert.IsTrue(@event.TicketClasses[0].Name == "Closing Party Ticket");
            Assert.IsTrue(@event.TicketClasses[0].Id == 39156118);
            Assert.IsTrue(@event.TicketClasses[0].OnSaleStatus == "AVAILABLE");
            Assert.IsTrue(@event.TicketClasses[0].MinimumQuantity == 1);
            Assert.IsTrue(@event.TicketClasses[0].MaximumQuantity == 0);
            Assert.IsTrue(@event.TicketClasses[0].Donation.Value == false );
            Assert.IsTrue(@event.TicketClasses[0].EventId == 18610752261);
            Assert.IsTrue(@event.TicketClasses[0].Free.Value == false);
            Assert.IsTrue(@event.TicketClasses[1].Id == 46100695);
            Assert.IsTrue(@event.TicketClasses[1].Name == "2016 Annual Convention - Defining Moments Ticket");
       }
       const string Categories = @"{""locale"": ""en_US"", ""pagination"": {""object_count"": 20, ""page_number"": 1, ""page_size"": 50, ""page_count"": 1}, ""categories"": [{""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/103/"", ""id"": ""103"", ""name"": ""Music"", ""name_localized"": ""Music"", ""short_name"": ""Music"", ""short_name_localized"": ""Music""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/101/"", ""id"": ""101"", ""name"": ""Business & Professional"", ""name_localized"": ""Business & Professional"", ""short_name"": ""Business"", ""short_name_localized"": ""Business""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/110/"", ""id"": ""110"", ""name"": ""Food & Drink"", ""name_localized"": ""Food & Drink"", ""short_name"": ""Food & Drink"", ""short_name_localized"": ""Food & Drink""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/113/"", ""id"": ""113"", ""name"": ""Community & Culture"", ""name_localized"": ""Community & Culture"", ""short_name"": ""Community"", ""short_name_localized"": ""Community""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/105/"", ""id"": ""105"", ""name"": ""Performing & Visual Arts"", ""name_localized"": ""Performing & Visual Arts"", ""short_name"": ""Arts"", ""short_name_localized"": ""Arts""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/104/"", ""id"": ""104"", ""name"": ""Film, Media & Entertainment"", ""name_localized"": ""Film, Media & Entertainment"", ""short_name"": ""Film & Media"", ""short_name_localized"": ""Film & Media""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/108/"", ""id"": ""108"", ""name"": ""Sports & Fitness"", ""name_localized"": ""Sports & Fitness"", ""short_name"": ""Sports & Fitness"", ""short_name_localized"": ""Sports & Fitness""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/107/"", ""id"": ""107"", ""name"": ""Health & Wellness"", ""name_localized"": ""Health & Wellness"", ""short_name"": ""Health"", ""short_name_localized"": ""Health""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/102/"", ""id"": ""102"", ""name"": ""Science & Technology"", ""name_localized"": ""Science & Technology"", ""short_name"": ""Science & Tech"", ""short_name_localized"": ""Science & Tech""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/109/"", ""id"": ""109"", ""name"": ""Travel & Outdoor"", ""name_localized"": ""Travel & Outdoor"", ""short_name"": ""Travel & Outdoor"", ""short_name_localized"": ""Travel & Outdoor""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/111/"", ""id"": ""111"", ""name"": ""Charity & Causes"", ""name_localized"": ""Charity & Causes"", ""short_name"": ""Charity & Causes"", ""short_name_localized"": ""Charity & Causes""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/114/"", ""id"": ""114"", ""name"": ""Religion & Spirituality"", ""name_localized"": ""Religion & Spirituality"", ""short_name"": ""Spirituality"", ""short_name_localized"": ""Spirituality""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/115/"", ""id"": ""115"", ""name"": ""Family & Education"", ""name_localized"": ""Family & Education"", ""short_name"": ""Family & Education"", ""short_name_localized"": ""Family & Education""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/116/"", ""id"": ""116"", ""name"": ""Seasonal & Holiday"", ""name_localized"": ""Seasonal & Holiday"", ""short_name"": ""Holiday"", ""short_name_localized"": ""Holiday""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/112/"", ""id"": ""112"", ""name"": ""Government & Politics"", ""name_localized"": ""Government & Politics"", ""short_name"": ""Government"", ""short_name_localized"": ""Government""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/106/"", ""id"": ""106"", ""name"": ""Fashion & Beauty"", ""name_loca lized"": ""Fashion & Beauty"", ""short_name"": ""Fashion"", ""short_name_localized"": ""Fashion""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/117/"", ""id"": ""117"", ""name"": ""Home & Lifestyle"", ""name_localized"": ""Home & Lifestyle"", ""short_name"": ""Home & Lifestyle"", ""short_name_localized"": ""Home & Lifestyle""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/118/"", ""id"": ""118"", ""name"": ""Auto, Boat & Air"", ""name_localized"": ""Auto, Boat & Air"", ""short_name"": ""Auto, Boat & Air"", ""short_name_localized"": ""Auto, Boat & Air""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/119/"", ""id"": ""119"", ""name"": ""Hobbies & Special Interest"", ""name_localized"": ""Hobbies & Special Interest"", ""short_name"": ""Hobbies"", ""short_name_localized"": ""Hobbies""}, {""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/199/"", ""id"": ""199"", ""name"": ""Other"", ""name_localized"": ""Other"", ""short_name"": ""Other"", ""short_name_localized"": ""Other""}]} ";

        public static class JsonData
        {
            public static string OrganizerJsonArray = @"{""organizer"": [{""url"": ""http://www.eventbrite.com/o/test-organization-1111"", ""description"":{ ""text"":""test-organization"" ,""html"":""<p>bla</p>"" }, ""id"": 1111, ""name"": ""test-organization"", ""num_past_events"":10}]}";
            public static string OrganizerJson = @"{""organizer"": {""url"": ""http://www.eventbrite.com/o/test-organization-1111"", ""description"":{ ""text"":""test-organization"" ,""html"":""<p>bla</p>"" }, ""id"": 1111, ""name"": ""test-organization"", ""num_past_events"":10}}";
            public static string UserJson = @"{""user"": {""name"":""test"", ""first_name"": ""test"", ""last_name"": ""form"", ""user_id"": 4615917,  ""email"": ""test@test.com"", ""emails"":[{""email"":""test@test.com"", ""verified"":true, ""primary"":true}]}}";
            public static string UserJsonArray = @"{""user"": [{""name"":""test"", ""first_name"": ""test"", ""last_name"": ""form"", ""user_id"": 4615917,  ""email"": ""test@test.com"", ""emails"":[{""email"":""test@test.com"", ""verified"":true, ""primary"":true}]}]}";
            public static string VenueJsonArray = @"{
  ""venue"": [
    {
      ""name"": ""venue007"",
      ""longitude"": -122.40007,
      ""latitude"": 37.77552,
      ""id"": 1524221,
      ""address"": {""address_1"": ""Apartment 106"",
                    ""address_2"": ""45 Royal Street"",
                    ""city"": ""London"",
                    ""region"": ""London"",
                    ""postal_code"": ""SW1A 1AA"",
                    ""country"": ""GB"",
                    ""country_name"": ""United Kingdom""  }
    }
  ]
}";
            public static string VenueJson = @"{
  ""venue"":
    {
     ""name"": ""venue007"",
      ""longitude"": -122.40007,
      ""latitude"": 37.77552,
      ""id"": 1524221,
      ""address"": {""address_1"": ""Apartment 106"",
                    ""address_2"": ""45 Royal Street"",
                    ""city"": ""London"",
                    ""region"": ""London"",
                    ""postal_code"": ""SW1A 1AA"",
                    ""country"": ""GB"",
                    ""country_name"": ""United Kingdom""  }
    }
}";

            public static string AttendeeJsonArray = @"{
                ""attendee"": [ {
                    ""id"":11111111111,
                    ""created"":""2013-06-17 09:54:45"",
                    ""changed"": ""2013-06-17 09:55:02"", 
                    ""ticket_class_id"": 222,
                    ""profile"":{  
                                  ""name"":""dddd"",
                                  ""first_name"":""aaaa"",
                                  ""last_name"": ""ssss"",
                                  ""email"" : ""ssss@ddd.com"",
                                  ""prefix"": ""dr."",
                                  ""suffix"": ""jr"",
                                  ""age"":45,
                                  ""job_title"":""ddddd"",
                                  ""company"":""zzzzzzzz"",
                                  ""website"": ""wetwetrwe"",
                                  ""blog"": ""dsdsfs"",
                                  ""gender"":""m"",
                                  ""birth_date"":""1957-04-17"",
                                  ""cell_phone"":""345-234-1122""
                                        },
                    ""addresses"":{ ""home"":{""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom"" }, 
                                    ""ship"": {""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom"" }, 
                                    ""work"":{""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom""}
                                     },
                    ""answers"": [{""question_id"":""24"",""question"":""dddddd"", ""type"":""mmmm"", ""answer"":""ddgdfg""} ],
                    ""barcodes"": [{""barcode"":""ddddd"", ""status"":""dddd"",""created"":""2013-06-17 09:54:45"", ""changed"":""2013-06-17 09:54:45""} ],
                    ""team"": {""id"":""ddd"", ""name"":""dddd"", ""date_joined"":""2013-06-17 09:54:45"", ""event_id"":179947891 },
                    ""event_id"": 6330882841,
                    ""order_id"": 179947891
		     
            }
       ]  }";


            public static string AttendeeJson = @"{
                     ""id"":11111111111,
                    ""created"":""2013-06-17 09:54:45"",
                    ""changed"": ""2013-06-17 09:55:02"", 
                    ""ticket_class_id"": 222,
                    ""profile"":{  
                                  ""name"":""dddd"",
                                  ""first_name"":""aaaa"",
                                  ""last_name"": ""ssss"",
                                  ""email"" : ""ssss@ddd.com"",
                                  ""prefix"": ""dr."",
                                  ""suffix"": ""jr"",
                                  ""age"":45,
                                  ""job_title"":""ddddd"",
                                  ""company"":""zzzzzzzz"",
                                  ""website"": ""wetwetrwe"",
                                  ""blog"": ""dsdsfs"",
                                  ""gender"":""m"",
                                  ""birth_date"":""1957-04-17"",
                                  ""cell_phone"":""345-234-1122""
                                        },
                    ""addresses"":{ ""home"":{""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom"" }, 
                                    ""ship"": {""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom"" }, 
                                    ""work"":{""address_1"": ""Apartment 106"",
                                              ""address_2"": ""45 Royal Street"",
                                              ""city"": ""London"",
                                              ""region"": ""London"",
                                              ""postal_code"": ""SW1A 1AA"",
                                              ""country"": ""GB"",
                                              ""country_name"": ""United Kingdom""}
                                     },
                    ""answers"": [{""question_id"":24,""question"":""dddddd"", ""type"":""mmmm"", ""answer"":""ddgdfg""} ],
                    ""barcodes"": [{""barcode"":""ddddd"", ""status"":""dddd"",""created"":""2013-06-17 09:54:45"", ""changed"":""2013-06-17 09:54:45""} ],
                    ""team"": {""id"":""ddd"", ""name"":""dddd"", ""date_joined"":""2013-06-17 09:54:45"", ""event_id"":""179947891"" },
                    ""event_id"": 6330882841,
                    ""order_id"": 179947891
             
           
            }";

            public static string UserTickets = @"{
    ""user_tickets"": [
        {
           ""user"": {
                ""id"": 4617777,
                ""email"": ""test@test.com""
            }
        },
        {
            ""orders"": [
                {
                    ""order"": {
                        ""status"": ""Order Completed"",
                        ""gross"": ""1.22"",
                        ""first_name"": ""jerry"",
                        ""last_name"": ""test"",
                        ""attendees"": [
                            {
                                ""attendee"": {
                                    ""status"": ""Attending"",
                                    ""first_name"": ""jerry"",
                                    ""last_name"": ""test"",
                                    ""created"": ""2014-01-03 14:27:12"",
                                    ""modified"": ""2014-01-03 14:27:22"",
                                    ""id"": 304654313
                                }
                            }
                        ],
                        ""created"": ""2014-01-03 14:27:12"",
                        ""event"": {
                            ""description"": ""test"",
                            ""end_date"": ""2014-01-04 10:00:00"",
                            ""title"": ""Test 2014-01-03"",
                            ""url"": ""https://www.eventbrite.com/e/test-2014-01-03-tickets-10017444444"",
                            ""privacy"": ""Public"",
                            ""start_date"": ""2014-01-04 08:00:00"",
                            ""logo_ssl"": ""https://www.eventbrite.com/php/logo.php?id="",
                            ""logo"": ""http://eventbrite-s3.s3.amazonaws.com/eventlogos/48219932/"",
                            ""timezone"": ""America/Chicago"",
                            ""organizer"": {
                                ""url"": ""http://www.eventbrite.com/o/accion-womens-business-center-3145950574"",
                                ""description"": ""test"",
                                ""long_description"": ""The Women's Business Center Test "",
                                ""id"": 3145950574,
                                ""name"": ""Womens Business Center""
                            },
                            ""id"": 10017445449
                        },
                        ""modified"": ""2014-01-03 14:27:22"",
                        ""delivery_method"": ""eTicket"",
                        ""currency"": ""USD"",
                        ""payment_type"": ""free"",
                        ""id"": 240130811
                    }
                }
            ]
        }
    ]
}";

            public static string Event = @"
{
    ""event"": 
  {
     ""name"": {
        ""text"": ""Event with Custom Q"", 
        ""html"": ""Event with Custom Q""
    }, 
    ""description"": {
        ""text"": null, 
        ""html"": null
    }, 
    ""id"": ""11109810743"", 
    ""url"": ""http://www.eventbrite.com/e/event-with-custom-q-tickets-11109810743"", 
    ""start"": {
        ""timezone"": ""America/Los_Angeles"", 
        ""local"": ""2016-11-30T19:00:00"", 
        ""utc"": ""2016-12-01T03:00:00Z""
    }, 
    ""end"": {
        ""timezone"": ""America/Los_Angeles"", 
        ""local"": ""2016-11-30T22:00:00"", 
        ""utc"": ""2016-12-01T06:00:00Z""
    }, 
    ""created"": ""2014-03-27T22:27:04Z"", 
    ""changed"": ""2015-12-04T01:11:55Z"", 
    ""capacity"": 1201, 
    ""status"": ""live"", 
    ""currency"": ""USD"", 
    ""listed"": false, 
    ""shareable"": true, 
    ""online_event"": true, 
    ""tx_time_limit"": 480, 
    ""hide_start_date"": false, 
    ""locale"": ""en_US"", 
    ""is_locked"": false, 
    ""privacy_setting"": ""unlocked"", 
    ""is_series"": false, 
    ""is_series_parent"": false, 
    ""is_reserved_seating"": false, 
    ""logo_id"": null, 
    ""organizer_id"": ""6230879969"", 
    ""venue_id"": null, 
    ""category_id"": null, 
    ""subcategory_id"": null, 
    ""format_id"": null, 
    ""resource_uri"": ""https://www.eventbriteapi.com/v3/events/11109810743/"", 
    ""logo"": null
  }
}";

            public static string EventWithExpensions = @"
{
    ""event"": 
  {
     ""name"": {
        ""text"": ""Event with Custom Q"", 
        ""html"": ""Event with Custom Q""
    }, 
    ""description"": {
        ""text"": null, 
        ""html"": null
    }, 
    ""id"": ""11109810743"", 
    ""url"": ""http://www.eventbrite.com/e/event-with-custom-q-tickets-11109810743"", 
    ""start"": {
        ""timezone"": ""America/Los_Angeles"", 
        ""local"": ""2016-11-30T19:00:00"", 
        ""utc"": ""2016-12-01T03:00:00Z""
    }, 
    ""end"": {
        ""timezone"": ""America/Los_Angeles"", 
        ""local"": ""2016-11-30T22:00:00"", 
        ""utc"": ""2016-12-01T06:00:00Z""
    }, 
    ""created"": ""2014-03-27T22:27:04Z"", 
    ""changed"": ""2015-12-04T01:11:55Z"", 
    ""capacity"": 1201, 
    ""status"": ""live"", 
    ""currency"": ""USD"", 
    ""listed"": false, 
    ""shareable"": true, 
    ""online_event"": true, 
    ""tx_time_limit"": 480, 
    ""hide_start_date"": false, 
    ""locale"": ""en_US"", 
    ""is_locked"": false, 
    ""privacy_setting"": ""unlocked"", 
    ""is_series"": false, 
    ""is_series_parent"": false, 
    ""is_reserved_seating"": false, 
    ""logo_id"": null, 
    ""organizer_id"": ""6230879969"", 
    ""venue_id"": null, 
    ""category_id"": null, 
    ""subcategory_id"": null, 
    ""format_id"": null, 
    ""resource_uri"": ""https://www.eventbriteapi.com/v3/events/11109810743/"", 
    ""logo"": null,
    ""category"": {
        ""resource_uri"": ""https://www.eventbriteapi.com/v3/categories/101/"", 
        ""id"": ""101"", 
        ""name"": ""Business & Professional"", 
        ""name_localized"": ""Business & Professional"", 
        ""short_name"": ""Business"", 
        ""short_name_localized"": ""Business""
    }, 

     ""organizer"": {
        ""description"": {
            ""text"": ""SendOutCards"", 
            ""html"": ""<P>SendOutCards<\/P>""
        }, 
        ""logo"": {
            ""id"": ""97"", 
            ""url"": ""https://cdn.evbuc.com/images/logo.jpg"", 
            ""aspect_ratio"": null, 
            ""edge_color"": null, 
            ""edge_color_set"": null
        }, 
        ""resource_uri"": ""https://www.eventbriteapi.com/v3/"", 
        ""id"": ""311"", 
        ""name"": ""SendOutCards"", 
        ""url"": ""http://www.eventbrite.com/o/sendoutcards"", 
        ""num_past_events"": 39, 
        ""num_future_events"": 4
    },
    ""venue"": {
        ""address"": {
            ""address_1"": ""100 West"", 
            ""address_2"": null, 
            ""city"": ""City"", 
            ""region"": ""UT"", 
            ""postal_code"": ""84101"", 
            ""country"": ""US"", 
            ""latitude"": 40.7669304, 
            ""longitude"": -111.89518520000001
        }, 
        ""resource_uri"": ""https://www.venues/"", 
        ""id"": ""11454554"", 
        ""name"": ""Convention Center"", 
        ""latitude"": ""40.7669304"", 
        ""longitude"": ""-111.89518520000001""
    },
    ""subcategory"": {
        ""resource_uri"": ""https://www.eventbriteapi.com/v3/subcategories/1007/"", 
        ""id"": ""1007"", 
        ""name"": ""Sales & Marketing""
    },
    ""format"": {
        ""resource_uri"": ""https://www.eventbriteapi.com/v3/formats/4/"", 
        ""id"": ""4"", 
        ""name"": ""Convention"", 
        ""name_localized"": ""Convention"", 
        ""short_name"": ""Convention"", 
        ""short_name_localized"": ""Convention""
    },
 ""logo"": {
        ""id"": ""20016442"", 
        ""url"": ""https://img.evbuc.com/d310"", 
        ""aspect_ratio"": ""2"", 
        ""edge_color"": ""#cabdb5"", 
        ""edge_color_set"": true
    },
    ""ticket_classes"": [
        {
            ""cost"": {
                ""display"": ""$50.00"", 
                ""currency"": ""USD"", 
                ""value"": 5000, 
                ""major_value"": ""50.00""
            }, 
            ""fee"": {
                ""display"": ""$3.74"", 
                ""currency"": ""USD"", 
                ""value"": 374, 
                ""major_value"": ""3.74""
            }, 
            ""tax"": {
                ""display"": ""$0.00"", 
                ""currency"": ""USD"", 
                ""value"": 0, 
                ""major_value"": ""0.00""
            }, 
            ""resource_uri"": ""https://www.eventbriteapi.com/39156118/"", 
            ""id"": ""39156118"", 
            ""name"": ""Closing Party Ticket"", 
            ""description"": ""Tickets are priced per person"", 
            ""donation"": false, 
            ""free"": false, 
            ""minimum_quantity"": 1, 
            ""maximum_quantity"": null, 
            ""maximum_quantity_per_order"": 10, 
            ""on_sale_status"": ""AVAILABLE"", 
            ""variants"": [], 
            ""has_pdf_ticket"": true, 
            ""event_id"": ""18610752261""
        }, 
        {
            ""cost"": {
                ""display"": ""$179.00"", 
                ""currency"": ""USD"", 
                ""value"": 17900, 
                ""major_value"": ""179.00""
            }, 
            ""fee"": {
                ""display"": ""$10.84"", 
                ""currency"": ""USD"", 
                ""value"": 1084, 
                ""major_value"": ""10.84""
            }, 
            ""tax"": {
                ""display"": ""$0.00"", 
                ""currency"": ""USD"", 
                ""value"": 0, 
                ""major_value"": ""0.00""
            }, 
            ""resource_uri"": ""https://www.eventbriteapi.com/46100695/"", 
            ""id"": ""46100695"", 
            ""name"": ""2016 Annual Convention - Defining Moments Ticket"", 
            ""description"": null, 
            ""donation"": false, 
            ""free"": false, 
            ""minimum_quantity"": 1, 
            ""maximum_quantity"": null, 
            ""maximum_quantity_per_order"": 10, 
            ""on_sale_status"": ""AVAILABLE"", 
            ""variants"": [], 
            ""has_pdf_ticket"": true, 
            ""event_id"": ""18610752261""
        }
    ]
  }
}";
        }
    }
}

      
   